import { Component } from "react";
// 引入路由配置项
import { Route, Routes, Navigate } from 'react-router-dom'


// 引入二级组件
import Home from '../views/home'
import Cart from '../views/cart'
import Cate from '../views/cate'
import Main from '../views/main'

// 引入底部组件
import Foot from "../components/foot";


class Index extends Component {
    constructor() {
        super()
        this.state = {
        }
    }

    render() {
        return (
            <div>
                <Routes>
                    {/* 二级路由导航 */}
                    <Route path="home" element={<Home></Home>}></Route>
                    <Route path="cate" element={<Cate></Cate>}></Route>
                    <Route path="cart" element={<Cart></Cart>}></Route>
                    <Route path="main" element={<Main></Main>}></Route>
                    {/* 二级路由重定向 */}
                    <Route path="" element={<Navigate to='home' ></Navigate>}></Route>
                </Routes>
                <Foot></Foot>
            </div>
        )
    }
}

export default Index